package com.demo.project_template.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.demo.project_template.entity.User;
import com.demo.project_template.entity.UserView;
import com.demo.project_template.service.UserViewService;
import com.demo.project_template.vo.response.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 用户浏览用户表 前端控制器
 * </p>
 *
 * @author 杨玉龙
 * @since 2024-08-20 11:48:58
 */
@Api(tags = "用户浏览记录表")
@RestController
@RequestMapping("/userView")
public class UserViewController {
    @Resource
    private UserViewService userViewService;

    @ApiOperation(value = "用户查看自己的浏览记录")
    @GetMapping(value = "/userFind")
    public R<Page<User>> userFind(@RequestParam Integer pageNo,
                                  @RequestParam Integer pageSize,
                                  @RequestParam Long womanId){
        Page<User> users = userViewService.userFind(pageNo,pageSize,womanId);
        return R.success(users);
    }
}
